package com.hellomaker.redismq.starter;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(prefix = "spring.redis", name = {"mq-enable"}, havingValue = "false", matchIfMissing = true)
//@EnableConfigurationProperties(RedisMQProperties.class)
public class RedisMQPropertiesConfiguration {

    @Bean
    @ConditionalOnProperty(prefix = "spring.redis", name = {"host", "port"})
    @ConfigurationProperties(prefix = "spring.redis")
    RedisMQProperties redisMQProperties() {
        return new RedisMQProperties();
    }


}
